import request from '@/utils/request'

export function findAll(house) {
  return request({
    url: '/configs',
    method: 'get',
    params: {
      house: house
    }
  })
}

export function edit(config) {
  return request({
    url: `/configs/${config.id}`,
    method: 'put',
    params: config
  })
}

export function deleteById(id) {
  return request({
    url: `/configs/${id}`,
    method: 'delete'
  })
}

export function add(config) {
  return request({
    url: '/configs',
    method: 'post',
    params: config
  })
}

export function findAllVoltageMode() {
  return request({
    url: '/voltageModeConfigs',
    method: 'get'
  })
}

export function editVoltageMode(config) {
  return request({
    url: `/voltageModeConfigs/${config.id}`,
    method: 'put',
    params: config
  })
}

export function deleteVoltageModeById(id) {
  return request({
    url: `/voltageModeConfigs/${id}`,
    method: 'delete'
  })
}

export function addVoltageMode(config) {
  return request({
    url: '/voltageModeConfigs',
    method: 'post',
    params: config
  })
}

export function findAllSysConfigs() {
  return request({
    url: '/sysConfigs',
    method: 'get'
  })
}

export function updateSysConfigs(configs) {
  return request({
    url: '/sysConfigs',
    method: 'post',
    data: configs
  })
}
